package com.zdb.personal.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zdb.personal.po.ZdbPmsCommentPo;
import com.zdb.personal.service.ZdbPmsCommentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/comment")
public class ZdbPmsCommentController {

    @Resource
    private ZdbPmsCommentService commentService;


    /**
     * 查询user评论
     * @param uid
     * @return
     */
    @GetMapping("/queryUserById/{uid}")
    public List<ZdbPmsCommentPo> queryUserById(@PathVariable("uid")int uid){



        return this.commentService.list(new QueryWrapper<ZdbPmsCommentPo>().in("uid",uid));
    }

    /**
     * 查询骑手的评论
     * @param ridersId
     * @return
     */
    @GetMapping("/queryRedersById/{ridersId}")
    public List<ZdbPmsCommentPo> queryRedersById(@PathVariable("ridersId")int ridersId){



        return this.commentService.list(new QueryWrapper<ZdbPmsCommentPo>().in("uid",ridersId));



    }


}
